import Vue from 'vue'
import Router from 'vue-router'
import homePage from '@/components/page/homePage'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/homepage'
    },
    {
      path: '/homePage',
      name: 'homePage',
      component: homePage
    },
    {
      path: '/orderIndex',
      name: 'orderIndex',
      component: resolve => require(['@/components/page/orderIndex'], resolve)
    },
    {
      path: '/orderMenu',
      name: 'orderMenu',
      component: resolve => require(['@/components/page/orderMenu'], resolve),
      children: [
        {
          path: '/',
          redirect: '/orderMenu/pay'
        },
        {
          name: 'pay',
          path: '/orderMenu/pay',
          component: resolve => require(['@/components/page/orderMenuPay'], resolve)
        }
      ]
    },
    {
      path: '/foodIndex',
      name: 'foodIndex',
      component: resolve => require(['@/components/page/foodIndex'], resolve)
    }
  ]
})
